<?php
/**
 * Bom.php
 *
 * @copyright   2023 thingsworld.com.cn - All Rights Reserved
 * @link        http://thingsworld.com.cn/
 * @author      stiffer.chen <chenl@thingsworld.com.cn>
 * @created     2023-02-14 00:35:10
 * @modified    2023-02-14 00:35:10
 *
 */

namespace App\Models\Product\Type;

use App\Models\BaseModel;

class Bom extends BaseModel
{
    protected $table = 'product_type_bom';

    protected $fillable = [
        'product_type_id',
        'product_bom_id',
        'count',
    ];

    public function boms()
    {
        return $this->hasMany(Bom::class);
    }

    public function bom()
    {
        return $this->belongsTo(\App\Models\Product\Bom::class, 'product_bom_id');
    }
}